package com.nebula.upms.admin.support.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

//@WebListener
@Component("initListener")
public class InitListener implements ServletContextListener {
	private static final Logger LOGGER = LoggerFactory.getLogger(InitListener.class);

	@Override
	public void contextInitialized(ServletContextEvent event) {
		LOGGER.debug(">>>InitListener.contextInitialized()");
		
		String basePath=event.getServletContext().getContextPath();
		event.getServletContext().setAttribute("STATIC_SERVER", basePath+"");
		 
		/*String os = System.getProperty("os.name");
		if(os.toLowerCase().startsWith("win")){  
			BatuConstants.OS_BASE_PATH="D://temp/";
		} else{
			BatuConstants.OS_BASE_PATH="/data/temp/"; 
		}
		//启动消费队列线程
		new CustomerThread().start();*/




	}
	
	@Override
	public void contextDestroyed(ServletContextEvent event) {
		
	}

}
